package com.haiyou.dc.es.kafka;

import com.haiyou.dc.es.constant.EsConstant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Component;

/**
 * @author pc
 */
@Component
@Slf4j
public class EsHouseProducer {

    @Autowired
    private KafkaTemplate kafkaTemplate;

    public void sendMessage(Integer id) {
        log.info("---------------------->发送信息={}", id);
        kafkaTemplate.send(EsConstant.XUNWU_TOPIC_NAME, String.valueOf(id));
    }

}
